home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #14
/
Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO
/
math
/
maca_101.zip
/
ROOTS.DEM
< prev
Wrap
Text File
|
1996-01-30
|
2KB
|
54 lines
;ROOTS.DEM
;DEMO FILE FOR MASSCALC VERSION 1.00
;WRITTEN BY: Ralph W. Reid
;This file may only be distributed in its unmodified form.
;
;DESCRIPTION: This file primarily demonstrates root calculations.
;
;For the latest releases of MASSCALC and other software created by
;Ralph W. Reid, see http://www2.athenon.com/~rreid/products/00-index.html.
;
;HOW TO USE THIS FILE: This file may be piped into MASSCALC, and its
;output displayed as follows:
;TYPE ROOTS.DEM | MASSCALC | MORE
;This file may be redirected into MASSCALC and its output displayed
;as follows:
;MASSCALC < ROOTS.DEM | MORE
;These two commands should be run from the operating system prompt.
;show values of important predefined variables
_scale;
print: "function tolerance set =" _tolerance
;use a root function to find the constant value sqrt (2)
print: "Finding sqrt (2) with a root function:"
;parameters are: variable name, starting point, function, derivative
root_newton (x, 0, x - sqrt (2), 1);
;find the intersection of the equations:
; x ^ 2 - 2
; x
print:
print: "Finding the x and y intersection coordinates of (x^2 - 2) and (x):"
;parameters are variable name, low value, high value, function
x = root_secant (x, 0.1, 1e4, (x^2 - 2) - (x));
print: "x =" x
print: "y =" x^2 - 2
;finds one of the roots of x^2 - 1
print:
print: "Finding one of the roots of x^2 - 1:"
;parameters are variable name, starting point, step value, and function
root_muller (x, 0, 0.001, x^2-1);
;finds the x value when y = 3
print:
print: "Finds the value of EXP (x) where y = 3:"
print: "Values are shown as calculations are performed."
_out_iterations = 1; turns on interative output
;parameters are variable name, low value, high value, function
root_inthalf (x, 1, 500, exp (x) - 3);
print: "Function tolerance was set =" _tolerance ", so the last few digits"
print: "may not be significant."